<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>资金成本</title>
<link href="../tablecloth/tablecloth.css" rel="stylesheet" type="text/css" media="screen" />
<script type="../tablecloth/tablecloth.js"></script>
<script type="text/javascript" src="../Js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../Js/haidao.offcial.general.js"></script>
<script type="text/javascript" src="../Js/select.js"></script>
<script type="text/javascript" src="../Js/haidao.validate.js"></script>
<script src="../My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(function(){init();});
function init() {
	var page = parseInt(document.form1.currentPage.value);
	var pageCount = parseInt(document.form1.pageCount.value);
	var count=parseInt(document.form1.count.value);
	if (page == 1 && pageCount!=1) {
		document.form1.pre1.disabled = "disabled";
		return;
	}
	if (page == count && pageCount!=1) {
		document.form1.next1.disabled = "disabled";
		return;
	}
	if (pageCount == 1) {
		document.form1.pre1.disabled = "disabled";
		document.form1.next1.disabled = "disabled";
		document.form1.first1.disabled = "disabled";
		document.form1.end1.disabled = "disabled";
		return;
	}
} 

function first() {
	window.location.href = "<%=request.getContextPath()%>/capitalCost/capitalCost.do?currentPage=1" + getQueryData();
	
}

function next() {
	var page = parseInt(document.form1.currentPage.value);
	window.location.href = "<%=request.getContextPath()%>/capitalCost/capitalCost.do?currentPage=" + (page + 1) + getQueryData();
}

function pre() {
	var page = parseInt(document.form1.currentPage.value);
	window.location.href = "<%=request.getContextPath()%>/capitalCost/capitalCost.do?currentPage=" + (page - 1) + getQueryData();
}

function end() {
	var pageCount = parseInt(document.form1.pageCount.value);
	window.location.href = "<%=request.getContextPath()%>/capitalCost/capitalCost.do?currentPage=" + pageCount + getQueryData();
}

//拼接查询条件
function getQueryData(){
	var dayTime1=$("#dayTime1").val();
	var dayTime2=$("#dayTime2").val();
	var range=$("#range1").val();
	var queryper="&dayTime1="+dayTime1+"&dayTime2="+dayTime2+"&range="+range;
	return queryper;
	}

</script>
</head>

<body>
	<div>
		<div class="view-product">
			<div class="message-manage">
				<div class="manage-record margin-lr">
				<form name="form1" method="get" action="<%=request.getContextPath()%>/capitalCost/capitalCost.do">&nbsp;&nbsp;
						<a href="<%=request.getContextPath()%>/capitalCost/capitalCost.do?range=1">今天</a>&nbsp;&nbsp;
						<a href="<%=request.getContextPath()%>/capitalCost/capitalCost.do?range=7">最近七天</a>&nbsp;&nbsp;
						<a href="<%=request.getContextPath()%>/capitalCost/capitalCost.do?range=30">最近30天</a>&nbsp;&nbsp;
						<input type="hidden" name="range1" id="range1"  value="${range}" /> 
				                自定义时间：<input type="text" name="dayTime1" id="dayTime1" size="20"
			                            value="${dayTime1}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})">&nbsp;
				                             至  <input type="text" name="dayTime2" id="dayTime2" size="20" 
				                        value="${dayTime2}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})">&nbsp;&nbsp;
			            <input type="submit" id="addAction" value="筛选">&nbsp;&nbsp;</td>
			            </tr>
					</table>
					<div class="offcial-table margin-top clearfix">
						<div class="tr-th clearfix">
							<table width="100%" border="0">
								<thead>
									<tr>
										<th>统计日期</th>
										<th>短信</th>
										<th>费用</th>
										<th>活体认证</th>
										<th>费用</th>
										<th>同盾</th>
										<th>费用</th>
										<th>提现</th>
										<th>费用</th>
										<th>充值</th>
										<th>费用</th>
										<th>代扣</th>
										<th>费用</th>
										<th>算话反欺诈</th>
										<th>费用</th>
										<th>算话运营商</th>
										<th>费用</th>
										<th>算话不良（失信）</th>
										<th>费用</th>
										<th>总计</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${list}" var="u">
										<tr style="white-space: nowrap;">
											<td>${u.dayTime}</td>
											<td>${u.msg}</td>
											<td>${u.msgMoney}</td>
											<td>${u.face}</td>
											<td>${u.faceMoney}%</td>
											<td>${u.risk}</td>
											<td>${u.riskMoney}</td>
											<td>${u.withdrawal}</td>
											<td>${u.withMoney}</td>
											<td>${u.recharge}</td>
											<td>${u.rechMoney}</td>
											<td>${u.withhold}</td>
											<td>${u.withholdMoney}</td>
											<td>${u.shAntiFraud}</td>
											<td>${u.shAntiFraudMoney}</td>
											<td>${u.shOperator}</td>
											<td>${u.shOperatorMoney}</td>
											<td>${u.shBad}</td>
											<td>${u.shBadMoney}</td>
											<td>${u.sumMoney}</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
							<table><tbody><tr><td>
							    <input type="hidden" name="currentPage" value="${currentPage}" /> 
								<input type="hidden" name="pageCount" value="${pageCount}"/> 
								<input type="hidden" name="count" value="${count}"/>
								<input type="button" name="first1" value="首页" onclick="first()" class="button gray" /> 
								<input type="button" name="pre1" value="上一页" onclick="pre()" class="button green"/> 
								<input type="button" name="next1" value="下一页" onclick="next()" class="button blue"/> 
								<input type="button" name="end1" value="尾页" onclick="end()" class="button gray"/> 
								<font>第${currentPage}页, 共${pageCount}页,共${count}条数据</font>
							</td></tr></tbody></table>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>

</html>